<?

include_once "accesscontrol.php";

$q1 = "select * from job_aplicants t1, job_seeker_info t2 where t1.aplicant = t2.uname and t1.job_id = \"$_GET[job_id]\" order by t2.careerlevel desc";
$r1 = mysql_query($q1) or die(mysql_error());

//number of offer rerviews
$q22 = "select nv from job_post where job_id = \"$_GET[job_id]\" ";
$r22 = mysql_query($q22) or die(mysql_error());
$a22 = mysql_fetch_array($r22);

//number of offer aplicants
$q33 = "select count(aplicant) from job_aplicants where job_id = \"$_GET[job_id]\" ";
$r33 = mysql_query($q33) or die(mysql_error());
$a33 = mysql_fetch_array($r33);


echo "<br><table align=center width=460 cellspacing=0>
	<caption align=center><span class=HeaderClass>Aplicant list for Job ID $_GET[job_id] / position $position</span><br><span class=BlackText>This offer was reviewed $a22[0] time(s) and there is/are $a33[0] aplicant(s).</span> </caption>";

if($a33[0] > '0')
{
	echo "<tr class=TableHead><td width=150>Name </td><td>Career level </td><td>Availability employment </td></tr>";

	$col = "cococo";

	while ($a1 = mysql_fetch_array($r1))
	{
		$q2 = "select fname, lname, careerlevel, employment from job_seeker_info where uname = \"$a1[uname]\" ";
		$r2 = mysql_query($q2) or die(mysql_error());
		$a2 = mysql_fetch_array($r2);

		 if($col == "cococo")
		{ 
			 $col = "dddddd"; 
		}
	    else
		{ 
			$col = "cococo"; 
		} 

		$cl = career_level("", $a2[careerlevel]);

		echo "<tr bgcolor=\"$col\"><td><a class=BlackLink href=\"EmployerView2.php?uname=$a1[uname]\"> $a2[0] $a2[1] </a></td><td> $cl </td><td> $a1[employment] </td></tr>";
	}
}

echo "</table><center><br><a class=TNA href=managejobs.php> << go back </a></center>";

include_once('../footer.php'); 

?>